package com.feishi.core.media.audio;


import javax.sound.sampled.*;
import java.io.*;

/**
 * @version 1.0
 * @auth caixq
 * @time 18-4-27 16:42
 **/
public class AudioTest {
    public static void main(String[] args) throws IOException, UnsupportedAudioFileException, LineUnavailableException {
        String mFile="/home/caixq/一剑轻安.mp3";
        File in= new File(mFile);
        AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(in);
        DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioInputStream.getFormat());
//        info.getFormats();
        SourceDataLine auline = (SourceDataLine) AudioSystem.getLine(info);
        auline.open(audioInputStream.getFormat());
        auline.start();
    }
}
